MKSMBF$, MKDMBF$ Functions ---------------------------------------------------------------------------- Action Convert an IEEE-format number to a string containing a Microsoft-Binary-format number. Syntax MKSMBF$( single-precision-expression!) MKDMBF$( double-precision-expression#) Remarks These functions are used to write real numbers to random-access files using Microsoft Binary format. They are particularly useful for maintaining data files created with older versions of BASIC. The MKSMBF$ and MKDMBF$ functions convert real numbers in IEEE format to strings so they can be written to the random-access file. To write a real number to a random-access file in Microsoft Binary format, convert the number to a string using MKSMBF$ (for a single-precision number) or MKDMBF$ (for a double-precision number). Then store the result in the corresponding field (defined in the FIELD statement) and write the record to the file using the PUT statement. Currency numbers are not real numbers, so they cannot be converted to strings that contain Microsoft-Binary-format numbers. See Also CVSMBF, CVDMBF; CVI, CVL, CVS, CVD, CVC; MKI$, MKL$, MKS$, MKD$, MKC$ Example The following example stores real values in a file as Microsoft-Binary-Format numbers. TYPE Buffer NameField AS STRING * 20 ScoreField AS STRING * 4 END TYPE DIM RecBuffer AS Buffer OPEN "TESTDAT.DAT" FOR RANDOM AS #1 LEN=LEN(RecBuffer) PRINT "Enter a name and a score, separated by a comma." PRINT "Enter 'END, 0' to end input." INPUT NameIn$, Score I=0' Read names and scores from the console until the name is END. DO WHILE UCASE$(NameIn$) <> "END" I=I+1 RecBuffer.NameField=NameIn$ RecBuffer.ScoreField=MKSMBF$(Score) ' Convert to a string. PUT #1,I,RecBuffer INPUT NameIn$, Score LOOP PRINT I;" records written." CLOSE #1